import request from '@/utils/request'

/**
 * 获取规则列表
 * @param { page, pageSize} params
 * @returns
 */
export function getRuleListAPI (params) {
  return request({
    url: 'parking/rule/list',
    params
  })
}

/**
 * 添加计费规则
 */
export function addRuleAPI (data) {
  return request({
    url: '/parking/rule',
    data,
    method: 'POST'
  })
}

/**
 * 删除计费规则
 */
export function deleteRuleAPI (id) {
  return request({
    url: `/parking/rule/${id}`,
    method: 'DELETE'
  })
}

/**
 * 获取计费规则详情
 */
export function getRuleDetailAPI (id) {
  return request({
    url: `/parking/rule/${id}`,
    method: 'GET'
  })
}

/**
 * 编辑计费规则详情
 */
export function updateRuleDetailAPI (data) {
  return request({
    url: `/parking/rule`,
    method: 'PUT',
    data
  })
}
